//
//  HXHttpRequest.h
//  HXTClient
//
//  Created by lemon on 14-3-29.
//  Copyright (c) 2014年 easaa. All rights reserved.
//

#import <Foundation/Foundation.h>



@protocol HXHttpRequestDelegate;
@interface HXHttpRequest : NSObject //<ASIHTTPRequestDelegate>

@property (nonatomic, weak) id <HXHttpRequestDelegate> delegate;

@property (nonatomic, retain) id <ASICacheDelegate> downCache;

/**
 *  http请求
 *
 *  @param requestParams 请求参数
 *  @param strMethod     请求方法
 */
- (void)requestForParams:(NSDictionary *)requestParams andMethod:(NSString *)strMethod;

/**
 *  http请求
 *
 *  @param requestParams 请求参数
 *  @param strMethod     请求方法
 *  @param tag           请求tag，必须大于0
 */
- (void)requestForParams:(NSDictionary *)requestParams andMethod:(NSString *)strMethod andTag:(NSInteger)tag;


/**
 *  上传图片
 *
 *  @param requestParams 请求参数
 *  @param image         上传的图片
 *  @param strMethod     请求方法
 *  @param tag           请求tag，必须大于0
 */
- (void)requestForParams:(NSDictionary *)requestParams
              andUpImage:(UIImage *)image
               andMethod:(NSString *)strMethod
                  andTag:(NSInteger)tag;

+ (NSString *)startSyncRequestForParams:(NSDictionary *)dic method:(NSString *)strMethod;
@end

@protocol HXHttpRequestDelegate <NSObject>

- (void)requestFinished:(NSString *)responseString andStatusCode:(int)statusCode andTag:(NSInteger)tag;
- (void)requestFailed:(NSError *)error andTag:(NSInteger)tag;

@end
